<!DOCTYPE html>
<html lang="en">
<head>
	<meta charset="UTF-8">
	<title>vue.js</title>
    <script type="text/javascript" src="../js/vue.js"></script>
</head>
<body>
	<div id="app">
		<p>原始字符串：{{message}}</p>
		<p>计算后反转字符串：{{reverseMessage}}</p>
	</div>
	<script type="text/javascript">
		var vm = new Vue({
			el: '#app',
			data: {
				message: 'Hello World'
			},
			computed: {
				// 计算属性的getter
				reverseMessage: function() {
					// 'this' 指向vm实例
					return this.message.split('').reverse().join('')
				}
			}
		})
	</script>
</body>
</html>
